<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
    <style>
        body { font-family: Arial, sans-serif; display: flex; flex-direction: column; align-items: center; padding-top: 50px; }
        .login-box { width: 300px; border: 1px solid #eee; padding: 20px; }
        .form-group { margin-bottom: 15px; }
        label { display: block; margin-bottom: 5px; }
        input { width: 100%; padding: 8px; box-sizing: border-box; }
        button { width: 100%; padding: 10px; background: #4CAF50; color: white; border: none; cursor: pointer; }
        button:hover { background: #45a049; }
        .link { margin-top: 15px; text-align: center; }
        a { color: #0066cc; }
    </style>
</head>
<body>
    <h2>用户登录</h2>
    <form action="/login" method="GET">
            <label for="username">用户名：</label>
            <input type="text" id="username" name="username" required>
            <label for="password">密码：</label>
            <input type="password" id="password" name="password" required>
            <button type="submit">登录</button>
        </form>
        <div class="register-link">
            没有账号？<a href="/register.html">立即注册</a></br>
            <a href="/">回到首页</a>
    </div>

    <script>
        function login() {
            // 简单验证
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            if (username && password) {
                // 实际项目中会发送请求到服务器验证
                window.location.href = 'user.html';
            } else {
                alert('请输入用户名和密码');
            }
        }
    </script>
</body>
</html>